home *** CD-ROM | disk | FTP | other *** search
/ A.C.E. 2 / ACE CD 2.iso / FILES / UTILS / AMOS1.DMS / in.adf / Install.AMOS / Install.amosSourceCode
Encoding:
AMOS Source Code  |  1991-09-09  |  13.4 KB  |  478 lines

  1. ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  2. '
  3. '                        AMOS HARD DISK INSTALLER V2.1 
  4. '    
  5. '                              English version 
  6. '
  7. '                         By P.J.Hickman & R.Vanner
  8. '
  9. ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  10. Set Buffer 40
  11. Global SOURCE_NAME$,DEF,ARROW$,ARROW2$
  12. ARROW$=Chr$(171)+Chr$(171)+Chr$(171)
  13. ARROW2$=Chr$(187)+Chr$(187)+Chr$(187)
  14. DEF=True
  15. SET_UP_SCREEN
  16. On Menu Proc MENU_1,MENU_2
  17. Centre At(,10)+"Click right mouse button for menu"
  18. Bell 
  19. While Mouse Key<>2 : Wend 
  20. Repeat 
  21.    On Menu On 
  22.    Centre At(,10)+"Click right mouse button for menu"
  23. Until False
  24. Edit 
  25. Procedure FINI
  26.    Paper 0 : Pen 1
  27.    Cls 
  28.    Centre At(,10)+"Installation complete"
  29.    Bell 
  30.    Wait 250 : Locate 0,10 : Cline 
  31.    Centre At(,10)+"Click right mouse button for menu"
  32. End Proc
  33. Procedure DISK_COPY[WHERE$,T0$]
  34.    Dim STOR$(150)
  35.    TEMP=0
  36.    Paper 0 : Pen 1 : Locate 0,8 : Cline : Centre WHERE$
  37.    STOR$(0)=Dir First$(WHERE$)
  38.    Repeat 
  39.       Inc TEMP
  40.       STOR$(TEMP)=Dir Next$
  41.    Until STOR$(TEMP)=""
  42.    For LOP=0 To TEMP-1
  43.       If(WHERE$<>"") and(Right$(WHERE$,1)<>"/") and(Right$(WHERE$,1)<>":")
  44.          WHERE$=WHERE$+"/"
  45.       End If 
  46.       If Left$(STOR$(LOP),1)="*"
  47.          If Not Exist(T0$+Mid$(STOR$(LOP),2,29)-" ")
  48.             Mkdir T0$+Mid$(STOR$(LOP),2,29)-" "
  49.          End If 
  50.          DISK_COPY[WHERE$+Mid$(STOR$(LOP),2,29)-" ",T0$+Mid$(STOR$(LOP),2,29)-" "+"/"]
  51.       Else 
  52.          FILE_COPY[WHERE$+Mid$(STOR$(LOP),2,29)-" ",T0$+Mid$(STOR$(LOP),2,29)-" "]
  53.       End If 
  54.    Next LOP
  55.    WHERE$=""
  56. End Proc
  57. Procedure FILE_COPY[SOURCE$,DEST$]
  58.    FIND_LENGTH[SOURCE$]
  59.    FILE_LENGTH=Param
  60.    Reserve As Work 10,FILE_LENGTH
  61.    Paper 0
  62.    Pen 5
  63.    Locate 0,10
  64.    Centre "READING FILE '"+SOURCE$+"'"
  65.    Bload SOURCE$,Start(10)
  66.    Pen 4
  67.    Centre At(,12)+"WRITING FILE '"+DEST$+"'"
  68.    Bsave DEST$,Start(10) To Start(10)+FILE_LENGTH
  69.    Erase 10
  70.    Paper 0 : Pen 1
  71.    Locate ,10 : Cline 
  72.    Locate ,12 : Cline 
  73.    Locate ,13 : Cline 
  74. End Proc
  75. Procedure FIND_LENGTH[SOURCE$]
  76.    Open In 1,SOURCE$
  77.    L=Lof(1)
  78.    Close 
  79. End Proc[L]
  80. Procedure SET_UP_SCREEN
  81.    Screen Open 1,640,200,8,Hires
  82.    Palette $0,$FFF,$7F,$A7
  83.    Flash Off : Curs Off : Cls 0
  84.    Paper 0
  85.    Pen 1
  86.    Menu$(1)=" Startup Sequences "
  87.    Menu$(1,1)=" "+ARROW2$+" Append Startup-Sequence "+ARROW$+" "
  88.    Menu$(1,2)="    About Hard Disc Installer    "
  89.    Menu$(1,3)=" =============================== " : Menu Inactive(1,3)
  90.    Menu$(1,4)=" Quit                            "
  91.    Menu$(2)=" Installation "
  92.    Menu$(2,1)=" AMOS master disk "
  93.    Menu$(2,1,1)=" Just install AMOS      "
  94.    Menu$(2,1,2)=" Just AMOS help         "
  95.    Menu$(2,1,3)=" Install the whole disk "
  96.    Menu$(2,1,4)=" Whole disk help        "
  97.    Menu$(2,2)=" AMOS data disk   "
  98.    Menu$(2,2,1)=" Install all games "
  99.    Menu$(2,2,2)=" Help              "
  100.    Menu$(2,3)=" AMOS extras disk "
  101.    Menu$(2,3,1)=" Install all extras "
  102.    Menu$(2,3,2)=" Help               "
  103.    Menu On 
  104. End Proc
  105. Procedure MENU_1
  106.    If Choice(2)=1 and DEF=False
  107.       DEF=True
  108.       Menu$(1,1)=" "+ARROW2$+" Append Startup-Sequence "+ARROW$+" "
  109.       Menu Calc 
  110.    Else 
  111.       If Choice(2)=1 and DEF=True
  112.          DEF=False
  113.          Menu$(1,1)="     Forget Startup-Sequence     "
  114.          Menu Calc 
  115.       End If 
  116.    End If 
  117.    If Choice(2)=2
  118.       HELP_APPEND
  119.    End If 
  120.    If Choice(2)=4
  121.       Default 
  122.       Edit 
  123.    End If 
  124.    Cls 
  125. End Proc
  126. Procedure MENU_2
  127.    ' AMOS master disk 
  128.    If Choice(2)=1
  129.       If Choice(3)=1
  130.          INSTALL_JUST_AMOS
  131.       End If 
  132.       If Choice(3)=2
  133.          JUST_AMOS_HELP
  134.       End If 
  135.       If Choice(3)=3
  136.          INSTALL_MASTER
  137.       End If 
  138.       If Choice(3)=4
  139.          MASTER_HELP
  140.       End If 
  141.    End If 
  142.    ' AMOS data disk 
  143.    If Choice(2)=2
  144.       If Choice(3)=1
  145.          INSTALL_DATA
  146.       End If 
  147.       If Choice(3)=2
  148.          HELP_DATA
  149.       End If 
  150.    End If 
  151.    If Choice(2)=3
  152.       If Choice(3)=1
  153.          INSTALL_EXTRAS
  154.       End If 
  155.       If Choice(3)=2
  156.          EXTRAS_HELP
  157.       End If 
  158.    End If 
  159.    Cls 
  160. End Proc
  161. Procedure INSTALL_MASTER
  162.    INSERT_DISK["AMOS:"]
  163.    SELECT_DRIVE
  164.    DEST$=Param$
  165.    If DEST$<>"QUIT"
  166.       Cls : Paper 2 : Pen 1
  167.       Centre At(,4)+" Installing AMOS Master Disk "
  168.       Restore FOLDERS
  169.       Read AMOUNT
  170.       For LOP=1 To AMOUNT
  171.          Read FOLDER$
  172.          If Exist("AMOS:"+FOLDER$)
  173.             If Not Exist(DEST$+FOLDER$)
  174.                Mkdir DEST$+FOLDER$
  175.             End If 
  176.             SOURCE_NAME$="AMOS:"+FOLDER$+"/"
  177.             DISK_COPY[SOURCE_NAME$,DEST$+FOLDER$+"/"]
  178.          End If 
  179.       Next LOP
  180.       FILE_COPY["AMOS:AMOS_System/Def_icon.info",DEST$+"AMOS_System/Def_icon.info"]
  181.       FILE_COPY["AMOS:AMOS_System.info",DEST$+"AMOS_System.info"]
  182.       FILE_COPY["AMOS:AMOS_System/AMOS1_3_NTSC.Env",DEST$+"AMOS_System/AMOS1_3_NTSC.Env"]
  183.       FILE_COPY["AMOS:AMOS_System/AMOS1_3_PAL.Env",DEST$+"AMOS_System/AMOS1_3_PAL.Env"]
  184.       Restore FILES
  185.       Read AMOUNT
  186.       For LOP=1 To AMOUNT
  187.          Read FILE$
  188.          If Exist("AMOS:"+FILE$)
  189.             FILE_COPY["AMOS:"+FILE$,DEST$+FILE$]
  190.          End If 
  191.       Next LOP
  192.       If DEF=True
  193.          SEQUENCE_APPEND["AMOS:",DEST$]
  194.       End If 
  195.       Paper 0 : Pen 1
  196.       Print At(0,10);Space$(80);
  197.       Print At(0,4);Space$(80);
  198.       FINI
  199.    End If 
  200.    FOLDERS:
  201.    Data 4,"Keyboards","AMOS_System","Manual","Help"
  202.    FILES:
  203.    Data 10,"Hithere.AMOS","AMOS1.3","AMOS1.3.Info"
  204.    Data "Config1_3.AMOS","Install.AMOS"
  205.    Data "Keyboard_Definer.AMOS","Help.ACC"
  206.    Data "Map_Editor.AMOS"
  207.    Data "SpriteX.AMOS","Sprite_Grabber.AMOS"
  208. End Proc
  209. Procedure INSTALL_DATA
  210.    INSERT_DISK["AMOS_DATA:"]
  211.    SELECT_DRIVE
  212.    DEST$=Param$
  213.    If DEST$<>"QUIT"
  214.       Cls : Paper 2 : Pen 1
  215.       Centre At(,4)+" Installing AMOS Data Disk "
  216.       SOURCE_NAME$="AMOS_DATA:"
  217.       DISK_COPY[SOURCE_NAME$,DEST$]
  218.       FILE_COPY["AMOS_DATA:Castle_Amos.Amos.info",DEST$+"Castle_Amos.Amos.info"]
  219.       FILE_COPY["AMOS_DATA:Number_Leap.Amos.info",DEST$+"Number_Leap.Amos.info"]
  220.       FILE_COPY["AMOS_DATA:Magic_Forest.Amos.info",DEST$+"Magic_Forest.Amos.info"]
  221.       FILE_COPY["AMOS_DATA:Amosteroids.Amos.info",DEST$+"Amosteroids.Amos.info"]
  222.       If DEF=True
  223.          SEQUENCE_APPEND["AMOS_DATA:",DEST$]
  224.       End If 
  225.       FINI
  226.    End If 
  227. End Proc
  228. Procedure INSTALL_EXTRAS
  229.    INSERT_DISK["EXTRAS:"]
  230.    SELECT_DRIVE
  231.    DEST$=Param$
  232.    If DEST$<>"QUIT"
  233.       Cls : Paper 2 : Pen 1
  234.       Centre At(,4)+" Installing AMOS Extras Disk "
  235.       SOURCE_NAME$="EXTRAS:"
  236.       DISK_COPY[SOURCE_NAME$,DEST$]
  237.       If DEF=True
  238.          SEQUENCE_APPEND["EXTRAS:",DEST$]
  239.       End If 
  240.       FINI
  241.    End If 
  242. End Proc
  243. Procedure SELECT_DRIVE
  244.    F$=Fsel$(""," ","Please select the drive you","wish to install the files onto")
  245.    If F$<>""
  246.       If Right$(F$,1)<>":"
  247.          While(Right$(F$,1)<>"/") and(Right$(F$,1)<>":")
  248.             TEMP$=Left$(F$,Len(F$)-1)
  249.             Swap TEMP$,F$
  250.          Wend 
  251.       End If 
  252.    Else 
  253.       F$="QUIT"
  254.    End If 
  255. End Proc[F$]
  256. Procedure SEQUENCE_APPEND[N$,DEST$]
  257.    F$=Fsel$("","","Please pick a Startup-Sequence","to append")
  258.    If F$<>""
  259.       Append 1,F$
  260.       Print #1,"Assign "+N$+" "+DEST$;Chr$(10);
  261.       Close 
  262.    End If 
  263. End Proc
  264. Procedure HELP_APPEND
  265.    Menu Off 
  266.    Cls 0
  267.    Paper 3 : Pen 0
  268.    Centre At(,3)+"General Help (please don't panic!!!)"
  269.    Paper 0 : Pen 1
  270.    Cdown : Cdown 
  271.    Centre "Some of the programs which are contained on your AMOS disks need"
  272.    Cdown 
  273.    Centre "to access logical drives ( such as AMOS: )."
  274.    Cdown 
  275.    Cdown 
  276.    Centre "With the `Alter Startup-Sequence' option selected you will be given"
  277.    Cdown 
  278.    Centre "the option to alter a startup-sequence of your choice after "
  279.    Cdown 
  280.    Centre "installation of the basic software is complete."
  281.    Cdown 
  282.    Centre "WARNING- This option will add lines to any file you select, even"
  283.    Cdown 
  284.    Centre "if it is not a true startup-sequence. Please use it with care."
  285.    Cdown 
  286.    Cdown 
  287.    Centre "After you have read this please select the option which you require"
  288.    Cdown 
  289.    Centre "and then follow all of the instructions which are displayed."
  290.    Cdown 
  291.    Cdown 
  292.    Centre "This hard disk installer does not assume anything about the way"
  293.    Cdown 
  294.    Centre "your system is set up, so it should be 100% compatible with all machines."
  295.    MWAIT
  296.    Cls 0
  297.    Menu On 
  298. End Proc
  299. Procedure HELP_DATA
  300.    Menu Off 
  301.    Cls 0
  302.    Paper 3 : Pen 0
  303.    Centre At(,3)+"AMOS data disk Help (please don't panic!!!)"
  304.    Paper 0 : Pen 1
  305.    Cdown : Cdown 
  306.    Centre "The AMOS data disk contains all of the games which come free"
  307.    Cdown 
  308.    Centre "with the package, including AMOSTEROIDS, MAGIC FOREST and CASTLE AMOS."
  309.    Cdown 
  310.    Cdown 
  311.    Centre "If you select this option by accident you can change your mind"
  312.    Cdown 
  313.    Centre "by clicking on the QUIT button when the file selector pops up."
  314.    Cdown 
  315.    Cdown 
  316.    Centre "With the `Alter Startup-Sequence' option selected you will be given"
  317.    Cdown 
  318.    Centre "the option to alter a startup-sequence of your choice after "
  319.    Cdown 
  320.    Centre "installation of the basic software is complete."
  321.    Cdown 
  322.    Centre "This will define a new logical drive called AMOS_DATA:"
  323.    Cdown 
  324.    Centre "WARNING- This option will add lines to any file you select, even"
  325.    Cdown 
  326.    Centre "if it is not a true startup-sequence. Please use it with care."
  327.    MWAIT
  328.    Cls 0
  329.    Menu On 
  330. End Proc
  331. Procedure EXTRAS_HELP
  332.    Menu Off 
  333.    Cls 0
  334.    Paper 3 : Pen 0
  335.    Centre At(,3)+"Install extras Help"
  336.    Paper 0 : Pen 1
  337.    Cdown : Cdown 
  338.    Centre "The extras disk contains some very handy programs as well as"
  339.    Cdown 
  340.    Centre "the free SPRITE 600 collection."
  341.    Cdown 
  342.    Cdown 
  343.    Centre "If you select this option by accident you can change your mind"
  344.    Cdown 
  345.    Centre "by clicking on the QUIT button when the file selector pops up."
  346.    Cdown 
  347.    Cdown 
  348.    Centre "With the `Alter Startup-Sequence' option selected you will be given"
  349.    Cdown 
  350.    Centre "the option to alter a startup-sequence of your choice after "
  351.    Cdown 
  352.    Centre "installation of the basic software is complete."
  353.    Cdown 
  354.    Centre "This will define a new logical drive called EXTRAS:"
  355.    Cdown 
  356.    Centre "WARNING- This option will add lines to any file you select, even"
  357.    Cdown 
  358.    Centre "if it is not a true startup-sequence. Please use it with care."
  359.    MWAIT
  360.    Cls 0
  361.    Menu On 
  362. End Proc
  363. Procedure JUST_AMOS_HELP
  364.    Menu Off 
  365.    Cls 0
  366.    Paper 3 : Pen 0
  367.    Centre At(,3)+"Just install AMOS help"
  368.    Paper 0 : Pen 1
  369.    Cdown : Cdown 
  370.    Centre "This handy option will let you install AMOS onto your hard drive"
  371.    Cdown 
  372.    Centre "all by itself, none of the support programs or accessories are"
  373.    Cdown 
  374.    Centre "copied along with it."
  375.    Cdown 
  376.    Cdown 
  377.    Centre "If you have the `Alter Startup-Sequence' option selected the program"
  378.    Cdown 
  379.    Centre "will create a logical drive called AMOS: by altering a file which must"
  380.    Cdown 
  381.    Centre "be specified after the installation is complete."
  382.    MWAIT
  383.    Cls 0
  384.    Menu On 
  385. End Proc
  386. Procedure MASTER_HELP
  387.    Menu Off 
  388.    Cls 0
  389.    Paper 3 : Pen 0
  390.    Centre At(,3)+"Install whole AMOS help"
  391.    Paper 0 : Pen 1
  392.    Cdown : Cdown 
  393.    Centre "By selecting this menu option you will be able to copy AMOS and all of"
  394.    Cdown 
  395.    Centre "the accessories supplied with it (keyboard definer, config editor etc.)"
  396.    Cdown 
  397.    Centre "onto you hard drive."
  398.    Cdown 
  399.    Cdown 
  400.    Centre "When you select this option a file selector will pop up asking you to choose"
  401.    Cdown 
  402.    Centre "a place to put these files."
  403.    Cdown 
  404.    Cdown 
  405.    Centre "If you select this option by accident you can change your mind"
  406.    Cdown 
  407.    Centre "by clicking on the QUIT button when the file selector pops up."
  408.    Cdown 
  409.    Cdown 
  410.    Centre "If you have the `Alter Startup-Sequence' option selected the program"
  411.    Cdown 
  412.    Centre "will create a logical drive called AMOS: by altering a file which must"
  413.    Cdown 
  414.    Centre "be specified after the installation is complete."
  415.    MWAIT
  416.    Cls 0
  417.    Menu On 
  418. End Proc
  419. Procedure INSTALL_JUST_AMOS
  420.    INSERT_DISK["AMOS:"]
  421.    SELECT_DRIVE
  422.    DEST$=Param$
  423.    If DEST$<>"QUIT"
  424.       Cls : Paper 2 : Pen 1
  425.       Centre At(,4)+" Installing AMOS "
  426.       Restore FOLDERS2
  427.       Read AMOUNT
  428.       For LOP=1 To AMOUNT
  429.          Read FOLDER$
  430.          If Not Exist(DEST$+FOLDER$)
  431.             Mkdir DEST$+FOLDER$
  432.          End If 
  433.          SOURCE_NAME$="AMOS:"+FOLDER$+"/"
  434.          DISK_COPY[SOURCE_NAME$,DEST$+FOLDER$+"/"]
  435.       Next LOP
  436.       FILE_COPY["AMOS:AMOS_System/Def_icon.info",DEST$+"AMOS_System/Def_icon.info"]
  437.       FILE_COPY["AMOS:AMOS_System.info",DEST$+"AMOS_System.info"]
  438.       FILE_COPY["AMOS:AMOS_System/AMOS1_3_NTSC.Env",DEST$+"AMOS_System/AMOS1_3_NTSC.ENV"]
  439.       FILE_COPY["AMOS:AMOS_System/AMOS1_3_PAL.Env",DEST$+"AMOS_System/AMOS1_3_PAL.ENV"]
  440.       Restore FILES2
  441.       Read AMOUNT
  442.       For LOP=1 To AMOUNT
  443.          Read FILE$
  444.          FILE_COPY["AMOS:"+FILE$,DEST$+FILE$]
  445.       Next LOP
  446.       If DEF=True
  447.          SEQUENCE_APPEND["AMOS:",DEST$]
  448.       End If 
  449.       Paper 0 : Pen 1
  450.       Print At(0,10);Space$(80);
  451.       Print At(0,4);Space$(80);
  452.    End If 
  453.    FOLDERS2:
  454.    Data 1,"AMOS_System"
  455.    FILES2:
  456.    Data 2,"AMOS1.3","AMOS1.3.info"
  457. End Proc
  458. Procedure MWAIT
  459.    Paper 3
  460.    Pen 0
  461.    Centre At(,23)+" CLICK MOUSE TO CONTINUE"
  462.    Paper 0
  463.    Pen 1
  464.    While Mouse Key=0 : Wend 
  465.    Bell 
  466.    Print At(0,25);Space$(80);
  467. End Proc
  468. Procedure INSERT_DISK[NAME$]
  469.    If Not Exist(NAME$)
  470.       Bell 
  471.       Paper 0
  472.       Pen 1
  473.       Centre At(,10)+"Please insert "+Paper$(3)+Pen$(0)+NAME$+Paper$(0)+Pen$(1)+" into any drive"
  474.       While Not Exist(NAME$)
  475.       Wend 
  476.       Print At(0,10);Space$(80);
  477.    End If 
  478. End Proc